#ifndef __SCR_IO_H__
#define __SCR_IO_H__

#include "global.h"
#include <stdio.h>

extern int8_t cur_col;
extern int8_t cur_row;


#define TEXT_Y_MAX 15        //LCD最多显示的行数
#define BORDER_PADDING	5    //窗体边界宽度

void scr_gotoxy(int8_t col, int8_t row);
int8_t scr_getCurRow(void);
void scr_fontColor(unsigned short fontC, unsigned short fontBkC);
void scr_fontColorInvers(void);
void scr_fontColorNormal(void);
void scr_setfullTextWindow(void);
void scr_setTextWindow(uint16_t x, uint16_t y, uint8_t maxCol, uint8_t maxRow);
void scr_setScroll(uint8_t flag);
void scr_putc(char c , int8_t *col, int8_t *row);
void scr_puts(const char *);
void scr_putsat(const char *str, int8_t col, int8_t row);
void scr_clrEndl(void);
void scr_itoa(long val, int radix, int len);
void scr_printf(const char *, ...);
void scr_dump(const unsigned char *buff, int sz);

void scr_Line(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color);
void scr_Rectangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color, uint8_t fill);
void scr_Square(uint16_t x0, uint16_t y0, uint16_t with, uint16_t color, uint8_t fill);
void src_Circle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius, uint16_t color);
void src_Ellipse(int Xpos, int Ypos, int XRadius, int YRadius, uint16_t color);

void win_showWindow(uint16_t x0, uint16_t y0, uint8_t colSz, uint8_t rowSz, uint16_t cBorder, uint16_t cFill, uint16_t cText);
void win_showErrorWin(void);
void win_showMsgWin(void);
void win_showProgressBar(uint16_t x, uint16_t y, uint16_t dx, uint16_t dy, uint8_t p);
void win_showMenu(uint16_t x, uint16_t y, uint8_t col, uint8_t row, char *title);
void win_showMenuScroll(uint16_t x, uint16_t y, uint8_t col, uint8_t row, uint8_t startPos, uint8_t selPos, uint8_t lines);


#endif
